package com.ccys.cms.service.productAndService.impl;

import com.ccys.cms.service.productAndService.ProductListDetailSerivce;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.web.productAndService.ProductListDetailDto;
import com.ccys.db.entity.TblProductListDetail;
import com.ccys.db.mapper.TblProductListDetailMapper;
import com.ccys.db.page.PageDto;
import com.ccys.db.rely.service.impl.BaseServiceImpl;
import com.ccys.db.vo.web.productAndService.ProductListDetailVo;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@Slf4j
public class ProductListDetailServiceImpl extends BaseServiceImpl<TblProductListDetail> implements ProductListDetailSerivce {

    @Resource
    private TblProductListDetailMapper mapper;


    @Override
    public ResponseResult getPage(ProductListDetailDto dto) {
        PageDto.startPage();
        List<ProductListDetailVo> list = mapper.getList(dto);
        PageInfo<ProductListDetailVo> info = new PageInfo<>(list);
        return ResponseResult.success(info);
    }

    @Override
    public void deleteDetails(String listId) {
        mapper.deleteDetails(listId);
    }
}
